from django.conf.urls.defaults import *
from music.models import *


label_list = {
  'queryset': Label.objects.all(),
}
band_list = {
  'queryset': Band.objects.all(),
}
album_list = {
  'queryset': Album.objects.all(),
}
song_list = {
  'queryset': Song.objects.all(),
}


urlpatterns = patterns('',  
  # Labels
  url(
    regex   = '^labels/(?P<slug>[-\w]+)/$',
    view    = 'django.views.generic.list_detail.object_detail',
    kwargs  = label_list,
    name    = 'music_label_detail',
  ),
  url (
    regex   = '^labels/$',
    view    = 'django.views.generic.list_detail.object_list',
    kwargs  = label_list,
    name    = 'music_label_list',
  ),
  
  # Bands
  url(
    regex   = '^bands/(?P<slug>[-\w]+)/$',
    view    = 'django.views.generic.list_detail.object_detail',
    kwargs  = band_list,
    name    = 'music_band_detail',
  ),
  url (
    regex   = '^bands/$',
    view    = 'django.views.generic.list_detail.object_list',
    kwargs  = band_list,
    name    = 'music_band_list',
  ),
  
  # Albums
  url(
    regex   = '^albums/(?P<slug>[-\w]+)/$',
    view    = 'django.views.generic.list_detail.object_detail',
    kwargs  = album_list,
    name    = 'music_album_detail',
  ),
  url (
    regex   = '^albums/$',
    view    = 'django.views.generic.list_detail.object_list',
    kwargs  = album_list,
    name    = 'music_album_list',
  ),
  
  # Songs
  url(
    regex   = '^songs/(?P<slug>[-\w]+)/$',
    view    = 'django.views.generic.list_detail.object_detail',
    kwargs  = song_list,
    name    = 'music_song_detail',
  ),
  url (
    regex   = '^songs/$',
    view    = 'django.views.generic.list_detail.object_list',
    kwargs  = song_list,
    name    = 'music_song_list',
  ),
)